Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudv2/hdr: Fix off-by-one error for spans #3182

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

codebien
Copy link
Contributor

@codebien codebien commented Jul 10, 2023

What?

Fix the histogram's Spans encoding.

i.e., when encoding a sequence like the following: [1, 1, 1, 0, 2, 2]

The second span must be:
(offset=1, length=2)

And not:
(offset=2, length=2)

Why

histogram.Spans.Offset is expected to be the counter of the empty buckets and not the diff between the indexes.

Related PR(s)/Issue(s)

Follow-up on #3169

@codebien codebien added this to the v0.46.0 milestone Jul 10, 2023
@codebien codebien self-assigned this Jul 10, 2023
mstoykov
mstoykov previously approved these changes Jul 10, 2023
output/cloud/expv2/hdr.go Outdated Show resolved Hide resolved
histogram.Spans.Offset is expected to be the counter of the empty buckets and
not the diff between the indexes.

i.e., when encoding a sequence like the following:
[1, 1, 1, 0, 2, 2]

The second span must be:
(offset=1, length=2)

And not:
(offset=2, length=2)
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2023

Codecov Report

Merging #3182 (af3a3d2) into master (1b446a4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head af3a3d2 differs from pull request most recent head aeb50b0. Consider uploading reports for the commit aeb50b0 to get more accurate results

@@           Coverage Diff           @@
##           master    #3182   +/-   ##
=======================================
  Coverage   72.78%   72.79%           
=======================================
  Files         256      256           
  Lines       19697    19697           
=======================================
+ Hits        14337    14338    +1     
+ Misses       4464     4463    -1     
  Partials      896      896           
Flag Coverage Δ
ubuntu 72.73% <100.00%> (+0.02%) ⬆️
windows 72.62% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
output/cloud/expv2/hdr.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@codebien codebien marked this pull request as ready for review July 10, 2023 15:41
@codebien codebien merged commit 373d185 into master Jul 10, 2023
@codebien codebien deleted the fix-cloudv2-hdr-span-gap branch July 10, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants